<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=<!--{$CHARSET}-->" />
	<title><!--{$title}--> -<!--{$config_core.seo_title}--></title>
	<meta name="keywords" content="<!--{$config_core.head_keywords}-->" />
	<meta name="description" content="<!--{$config_core.head_description}-->" />
	<meta http-equiv="x-ua-compatible" content="ie=7" />
	<meta name="generator" content="CityBao System" />
	<meta name="author" content="www.citybao.net" />	
	<link href="<!--{$INSTALL_PATH}-->favicon.ico" rel="shortcut icon" />
	<link href="<!--{$INSTALL_PATH}-->favicon.ico" rel="bookmark" />
	<link href="<!--{$CSS_DIR}-->citybao.css" rel="stylesheet" type="text/css" />
	<link href="<!--{$CSS_DIR}-->member.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" language="javascript">
		var CB_CssPath = '<!--{$CSS_DIR}-->';
		var CB_ImgPath = '<!--{$IMG_DIR}-->';
		var CB_JsPath  = '<!--{$JS_DIR}-->';
		<!--{if $SAFE_DOMAIN != ''}-->
		document.domain = '<!--{$SAFE_DOMAIN}-->';
		<!--{/if}-->
	</script>
	<script type="text/javascript" src="<!--{$JS_DIR}-->jquery-1.4.2.min.js"></script>
</head>
<body>
<!--{include file='header.tpl'}-->
<!--{assign var='guide_suffix' value='会员登录'}-->
<!--{include file='guide.tpl'}-->
<div id="container" class="clearfix">
	<div class="login_mid marginTop5">
		<!--介绍-->
		<div class="new_introduce">
			<div class="introduce">
			<ul class="i_bs">
				<li><div class="iconb b05"></div>
				<p><span>本地休闲娱乐</span>您可以加入本地社区、网上逛逛本地商铺、参加团购活动等等。</p></li>
				<li><div class="iconb b02"></div>
				<p><span>宣传店铺销售产品</span>将您的店铺搬到网上，发布促销、产品信息及有奖活动等。</p></li>
				<li class="last"><div class="iconb b03"></div>
				<p><span>发布分类信息</span>找工作，租房子，二手交易，本地生活信息大全。</p></li>
				
			</ul>
			</div>
		</div>
		<!--介绍 /-->
	<!--登录-->
		<div class="login_box">
		
			<div class="boxbg">
			
				<div class="title"><!--{$SITE_NAME}-->会员登录</div>
				<form name="loginForm" id="loginForm" action="" method="post">
				<input type="hidden" name="forward" value="<!--{$forward}-->" id='forward' />
				<input type="hidden" name="validate" value="<!--{$validate}-->" />
				<div class="userinfo">
					<ul>
						<li>会员名：<input autocomplete="off" type="text" value="<!--{$username}-->" class="ipt-c ipt-t" name="username" id="username" maxlength="50" />
						<!--提示-->
	 					<div class="tipbox" id="error_tip" style="display:none;">
							<div class="box_top"></div>
							<div class="box_center">
							<span id="error_tip_text" class="">用户名不能为空</span><a title="关闭" href="#" onclick="document.getElementById('error_tip').style.display='none';"><em>关闭</em></a>
							</div>
							<div class="box_bottom"></div>
						</div>
						<div class="tipbox" id="username_tip" style="display:none;">
							<div class="box_top"></div>
							<div class="box_center">
							<span id="username_tip_text" class="">用户名不能为空</span><a title="关闭" href="#" onclick="document.getElementById('username_tip').style.display='none';"><em>关闭</em></a>
							</div>
							<div class="box_bottom"></div>
						</div>
						<!--提示 end-->
						
						</li>
						<li><span>密&nbsp;&nbsp;码：</span><input type="password" value="" class="ipt-t" name="password" id="password" maxlength="50"/>
						<!--错误提示-->
						<div class="tipbox" id="password_tip" style="display:none;">
						<div class="box_top"></div>
						<div class="box_center">
						<span id="password_tip_text">密码不能为空</span><a href="#" title="关闭" onclick="document.getElementById('password_tip').style.display='none';"><em>关闭</em></a>
						</div>
						<div class="box_bottom"></div>
						</div>
						<!--错误提示 end-->
						</li>
						<!--{if $captcha_login == 1}-->
						<li><span>验证码：</span><input type="text" value="" class="ipt-t" name="captcha" id="captcha" maxlength="6" style="width:80px;" />
						<span id="captcha_img" class="hide">
							<span><img id="check_img" src="" onclick="javascript:get_captcha();" title="点击更换验证码" class="pointer" /></span>
						</span>
						<!--错误提示-->
						<div class="tipbox" id="captcha_tip" style="display:none;">
						<div class="box_top"></div>
						<div class="box_center">
						<span id="captcha_tip_text">验证码不能为空</span><a href="#" title="关闭" onclick="document.getElementById('captcha_tip').style.display='none';"><em>关闭</em></a>
						</div>
						<div class="box_bottom"></div>
						</div>
						<!--错误提示 end-->
						</li>
						<!--{/if}-->
							
						<li class="s_state"><input type="checkbox" id="remember" class="tl" value="30" name="remember"/><label for="save_btn">30天不需要登录</label><span class="blueA"><a href="<!--{$INSTALL_PATH}-->member/getpass.php">找回密码</a></span></li>
						<li class="s_btn"><a href="javascript:void(0);"><input type="submit" value="" class="smb_btn" /></a></li>
					</ul>
				</div>
				</form>
				<div class="re_u">还不是<!--{$SITE_NAME}-->会员？</div>
				<a href="<!--{$INSTALL_PATH}-->member/register.php" class="smb_reg" title="立即注册"></a>
			</div>
			
			
		</div>
		<!--登录 /-->
	</div>
</div>
<script language="javascript" type="text/javascript">
	$(function() {
		/*决定是否提示错误信息*/
		var error = "<!--{$error}-->";
		if(error != ''){
			$("#error_tip_text").html(error);
			$("#error_tip").show();
		}
		//输入框样式
		$(':text,:password')
			.each(function(){
				if($(this).attr('id') == 'captcha'){
					$(this).addClass('fGray');
					$(this).attr('value','显示验证码');
				}
			})
			.focus(function(){
				var tid = $(this).attr('id')+'_tip';
				$("#"+tid).hide();
				$(this).removeClass('ipt-error');
				if($(this).attr('id') == 'captcha'){
					if($(this).attr('value') == '显示验证码'){
						$(this).removeClass('fGray');
						$(this).attr('value','');
					}
					if($("#captcha_img").is(":hidden")){
						$("#captcha_img").show();
						get_captcha();
					}
				}
			})
			.blur(function(){
				if($(this).val() == ''){
					var tid = $(this).attr('id')+'_tip';
					$("#"+tid).show();
					$(this).addClass('ipt-error');
					return;
				}
				if($(this).attr('id') == 'captcha'){
					checkCaptchaAjax();
				}
			});
	});
	
	$("#loginForm").submit(function(){
		var ajax = <!--{$login_ajax}-->;//是否启用Ajax登录
		var flag = true;
		$(':text,:password')
			.each(function(){
				if($(this).val() == ''){
					var tid = $(this).attr('id')+'_tip';
					$("#"+tid).show();
					$(this).addClass('ipt-error');
					flag=false;
				}
			});
		if(ajax){
			loginAjax($(this));
			return false;
		}else{
			return flag;
		}
	});
	
	function checkCaptchaAjax(){
		code = $("#captcha").val();
		$.ajax({
				url:'<!--{$INSTALL_PATH}-->ajax.php',
				type: "POST",
				data:'action=check-captcha&code='+code,
				success:function(responseText){
					if(responseText.search("yes")>=0){
						msg = 'hide';
					}else if(responseText.search("no")>=0){
						$("#captcha_tip_text").html('验证码输入错误！');
						$("#captcha_tip").show();
					}
					/*去掉提示，到服务器中验证
					else{
						$("#captcha_tip_text").html('异步通信错误！');
						$("#captcha_tip").show();
					}*/
			}});
	}
	
	function loginAjax(uform){
		$.ajax({
				url:window.location.herf,
				type: "POST",
				data:uform.serialize(),
				success:function(responseText){
					if(responseText.search("no")>=0){
						msg = responseText.substr(3);
					}else if(responseText.search("yes")>=0){
						msg = '登录成功！';
						url = responseText.substr(4);
						window.location.href = url;
					}else{
						msg = '异步通信错误,登录失败';
					}
					get_captcha();
					$("#error_tip_text").html(msg);
					$("#error_tip").show();
				}
			});
		return false;
	}
			
	function get_captcha() {
		var qq = Math.round((Math.random()) * 100000000);
		$.ajax({
			beforeSend:function(XHR){
				$("#check_img").attr('src', CB_ImgPath+"ajaxloading.gif");
			},
			error:function(){
				$("#captcha_img").html("<span class='fRed'>加载数据出错...</p>");
			},
			success:function(html){
				$("#check_img").attr('src', '<!--{$INSTALL_PATH}-->ajax.php?action=captcha&r=' + qq);
			}
		});
	}
</script>
<!--{include file='footer.tpl'}-->
</body>
</html>